package org.xczy.boot.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xczy.boot.entity.User;
import org.xczy.boot.service.UserService;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user2")
public class UserController {

  @Resource
  private UserService userService;

  @GetMapping("/{id}")
  public User getUser(@PathVariable("id") Integer id){
    return userService.getById(id);
  }

}
